package org.csu.demo.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@TableName("item")
public class Item {

    @TableId("itemid")
    private String itemId;
    @TableField("productid")
    private String productId;
    @TableField("listprice")
    private BigDecimal listPrice;
    @TableField("unitcost")
    private BigDecimal unitCost;
    @TableField("supplier")
    private int supplierId;
    private String status;
    @TableField("attr1")
    private String attribute1;

    @TableLogic
    @JsonIgnore
    private Integer deleted;

    public boolean isAllNull(){
        if(this.productId !=null ||this.listPrice !=null||this.supplierId != 0 ||this.unitCost !=null||this.status !=null||this.attribute1 !=null){
            return false;
        }else {
            return true;
        }
    }
}
